package com.wntms.zjy.dao;
import com.wntms.zjy.pojo.CustomerInformation;
import com.wntms.zjy.pojo.User;
import org.apache.ibatis.annotations.*;

import java.util.List;


/**
 * 客户信息Dao接口
 * 
 * @author group 4
 * @date 2022-11-22
 */
@Mapper
public interface CustomerInformationDaoz
{
    @Results({
            @Result(property = "id",column = "id"),
            @Result(property = "tel",column = "tel"),
            @Result(property = "uid",column = "uid"),
            @Result(property = "user",column = "uid",javaType = User.class,one = @One(select = "com.wntms.zjy.dao.UserDaoz.findById"))
    })
    @Select("select * from customer_information where id = #{id}")
    public CustomerInformation findById(Long id);

    /**
     * 查询客户信息列表
     * 
     * @param customerInformation 客户信息
     * @return 客户信息集合
     */
    public List<CustomerInformation> selectCustomerInformationList(CustomerInformation customerInformation);

    /**
     * 新增客户信息
     * 
     * @param customerInformation 客户信息
     * @return 结果
     */
    public int insertCustomerInformation(CustomerInformation customerInformation);

    /**
     * 修改客户信息
     * 
     * @param customerInformation 客户信息
     * @return 结果
     */
    public int updateCustomerInformation(CustomerInformation customerInformation);

    /**
     * 删除客户信息
     * 
     * @param id 客户信息主键
     * @return 结果
     */
    public int deleteCustomerInformationById(Long id);

    /**
     * 批量删除客户信息
     * 
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteCustomerInformationByIds(Long[] ids);
}
